#include "Fighter.h"

Fighter::Fighter()
{

}

Fighter::~Fighter()
{

}

void Fighter::Load()
{
	mSprite.Load("fighter.png");
}
void Fighter::Unload()
{
	mSprite.Unload();
}
void Fighter::Update(float deltaTime)
{
	const float Kspeed = 400.0f;

	if(Input_IsKeyDown(Keys::RIGHT))
	{
		mPosition.x+=Kspeed * deltaTime;
	}
	else if(Input_IsKeyDown(Keys::LEFT))
	{
		mPosition.x-=Kspeed * deltaTime;
	}
	if(Input_IsKeyDown(Keys::UP))
	{
		mPosition.y-=Kspeed * deltaTime;
	}
	else if(Input_IsKeyDown(Keys::DOWN))
	{
		mPosition.y+=Kspeed * deltaTime;
	}

}
void Fighter::Render()
{
		const int width = mSprite.GetWidth();
		const int height = mSprite.GetHeight();
		SVector2 offset(width * 0.5f,height * 0.5f);
		SVector2 renderPosition = mPosition - offset;
		mSprite.SetPosition(renderPosition);
		mSprite.Render();
}